<%@page import="vo.FileVO"%>
<%@page import="java.util.ArrayList"%>
<%@page import="dto.FileDTO"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>file_download_List.jsp</title>
<link rel="stylesheet" href="${pageContext.request.contextPath }/css/file.css"/>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/file.js"></script>
</head>
<body>
	<%
		request.setCharacterEncoding("utf-8");
	%>
	<jsp:useBean id="vo" class="vo.FileVO" scope="page"/>
	<jsp:setProperty property="*" name="vo"/>
	<%
		if(session.getAttribute("sessionMid") != null){
			String m_id = (String)session.getAttribute("sessionMid");
		}else{
			%><script type="text/javascript">alert(m_id);</script> <%
			%><script type="text/javascript">alert("로그인 페이지로 이동 합니다.");</script> <%
			%><script type="text/javascript">location.href = "/group2/index/index.jsp";</script> <%
		}	
		FileDTO dto = new FileDTO();
		dto.setVo(vo);
		ArrayList<FileVO> list = dto.downloadListSelect((String)session.getAttribute("sessionMid"));
	%>
	<form name="hiddenFrm" method="post">
		<input type="hidden" name="nowPage"/>
		<input type="hidden" name="find"/>
		<input type="hidden" name="mid"/>
	</form>
	<p>
	<img alt="" src="../images/m_title_file_get.png"/>
	
	<div id="file_list_find" style="width: 1000px;" align="right">
		<form name="frm" method="post" action="#">
			<input type="text" name="find"/>
			<input type="submit" value="검색"/>
		</form>	
	</div> 	
	<table id="file_table" style="width: 1000px;" align="left">
	     <tr id="file_title_items" style="width: 1000px;">
	     	<td id="file_title_upload_id" width="200px" align="center">보낸이</td>
	        <td id="file_title_name" width="500px" align="center">파일명</td>
	        <td id="file_title_send_date" width="200px" align="center">받은 일자</td>
	        <td id="file_title_download" width="100px" align="center">다운 받기</td>
	     </tr>
	     <%for(int i=0; i<list.size(); i++){ %>
	     	<%FileVO v = list.get(i); %>
			<tr id="file_list_items" style="width: 1000px;">
				<td id="file_list_upload_id" align="center"><%=v.getFile_download_employee_name() %></td>
				<td id="file_list_name"><%=v.getFile_download_filename() %></td>
				<td id="file_list_upload_date" align="center"><%=v.getFile_download_date() %></td>
				<td id="file_list_download" align="center">
           			<a style="text-align: center;" href="/group2/fileDowndload.do?filename=<%=v.getFile_download_filename() %>">다운로드</a>
				</td>
			</tr>
	     <%} %>
	</table>
	<p/><br/>
	<table width="872px" style="width: 1000px;" align="left">
		<tr align="center">
			<td style="font-size: 14px;">◀  1 2 3 4 5  ▶</td>
		</tr>
	</table>
</body>	
</html>